package com.njwb.day05;

public class TestPerson {
    public static void main(String[] args) {
        //实例的创建
        //Person():当类中没有定义构造方法时，隐式的提供一个无参的构造方法
        Person p=new Person();
        System.out.println(p);
        System.out.println(p.name);

        Person p2=new Person("武大郎");
        System.out.println(p2);
        System.out.println(p2.name);

        Person p3=new Person("西门",245);
        System.out.println(p3);
        System.out.println(p3.name);
        System.out.println(p3.age);
    }
}
